package com.guangyunl.a_array;
// 空指针异常
public class Demo10ArrayException {
    public static void main(String[] args) {
        int[] arr1 = new int[3];
        System.out.println("arr1.length = " + arr1.length);

        arr1 = null;
        System.out.println("arr1.length = " + arr1.length); // NullPointerException
    }
}
/*
arr1.length = 3
Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "arr1" is null
	at com.guangyunl.a_array.Demo10ArrayException.main(Demo10ArrayException.java:9)
 */